package com.advanced.commonlyUsedClass_2.enums;

/**
 * 为彩虹颜色定义枚举，并输出喜欢的彩虹颜色。
 *
 * @author: Jovi
 * @createTime: 2017-06-06 11:11
 **/
public class LikeColor {
    public static void likeColor(Rainbow rainbow) {
        switch (rainbow) {
            case RED:
                System.out.println("红色");
                break;
            case ORANGE:
                System.out.println("橙色");
                break;
            case YELLOW:
                System.out.println("黄色");
                break;
            case GREEN:
                System.out.println("绿色");
                break;
            case CYAN:
                System.out.println("青色");
                break;
            case BLUE:
                System.out.println("蓝色");
                break;
            case PURPLE:
                System.out.println("紫色");
                break;
        }
    }

    public static void main(String[] args) {
        System.out.println("Please select the color you like：");
        Rainbow rainbow = Rainbow.BLUE;
        likeColor(rainbow);
    }
}
